//
// Created by Max on 2024/5/14.
//

#ifndef MIC_DETECT_SAVE_FILE_H
#define MIC_DETECT_SAVE_FILE_H
#include "MicLoader.h"
#include "iostream"

class SaveFile {
public:
    SaveFile();
    ~SaveFile();
    int openFile(std::string &filePath);
    int closeFile();
    int writeToFile(void *buff, uint32_t size,uint32_t count);
    int fSeekFile(long offset,int where);
private:
    int createFolder(std::string &folderPath);
    int isFileExist(std::string &folderPath);
    int countFilesInDirectory(const std::string& path);
private:
    FILE *mFile;
    std::string mFilePath;
};


#endif //MIC_DETECT_SAVE_FILE_H
